package com.aplink.generic.constant.type;

import android.view.View;

public enum EnableConditionType {
	DISABLE("Disable"),
	ENABLE("Enabled"),
	GONE("Gone"),
	INVISIBLE("Invisible"),
	VISIBLE("Visible");
	public static EnableConditionType get(final String key) {
		for (final EnableConditionType operator : EnableConditionType.values()) {
			if (operator.mValue.equalsIgnoreCase(key)) {
				return operator;
			}
		}
		return null;
	}

	private String mValue;

	private EnableConditionType(final String value) {
		this.mValue = value;
	}

	public int getCode() {
		if (equals(EnableConditionType.VISIBLE)) {
			return View.VISIBLE;
		} else if (equals(EnableConditionType.INVISIBLE)) {
			return View.INVISIBLE;
		} else if (equals(EnableConditionType.GONE)) {
			return View.GONE;
		}
		return 0;
	}
}
